#ifndef VIDEO_THREAD_H_INCLUDED
#define VIDEO_THREAD_H_INCLUDED

#include "thread.h"
#include "highgui.h"
extern "C"
{
#include "avformat.h"
}
#include <list>
using std::list;

namespace vmon_web
{
    class WebSockHolder;
    class WebSockHolderEntry;

    class VideoThread: public Thread
    {
    public:
        VideoThread();
        virtual ~VideoThread();

        virtual void addSockHolder(WebSockHolder* sockHolder);
        virtual void removeSockHolder(WebSockHolder* sockHolder);
        virtual void openVideoInput();
        virtual void run();
        virtual void stop();
    protected:
        virtual IplImage* captureImage();
    protected:
        list<WebSockHolderEntry*> m_sockHolders;
		CvCapture* m_capture;
        bool m_stopVideo;
    };
}


#endif
